﻿using IDEAMS.core;
using IDEAMS.model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace IDEAMS.view
{
    /// <summary>
    /// About.xaml 的交互逻辑
    /// </summary>
    public partial class About : Window
    {
        private AboutViewModel windowViewModel;
        public About()
        {
            InitializeComponent();

            windowViewModel = new AboutViewModel();
            this.DataContext = windowViewModel;

            this.btnOK.Click += new RoutedEventHandler(OK_Click);
        }

        private void OK_Click(object sender, RoutedEventArgs e)
        {
            this.Close();
        }
    }

    public class AboutViewModel : ViewModelBase
    {
        public AboutViewModel()
        {
            title = TW_App.TITLE;
            version = TW_App.VERSION;
        }

        private string m_title;
        public string title
        {
            get { return m_title; }
            set { 
                m_title = value;
                NotifyPropertyChanged();
            }
        }

        private string m_version;
        public string version
        {
            get { return m_version; }
            set
            {
                m_version = value;
                NotifyPropertyChanged();
            }
        }
    }
}
